<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1"><title id="de20941">DROP RULE</title><body><p id="sql_command_desc">Removes a rewrite rule.</p><section id="section2"><title>Synopsis</title><codeblock id="sql_command_synopsis">DROP RULE [IF EXISTS] <varname>name</varname> ON <varname>table_name</varname> [CASCADE | RESTRICT]</codeblock></section><section id="section3"><title>Description</title><p><codeph>DROP RULE</codeph> drops a rewrite rule from a table or view.</p></section><section id="section4"><title>Parameters</title><parml><plentry><pt>IF EXISTS</pt><pd>Do not throw an error if the rule does not exist. A notice is issued
in this case.</pd></plentry><plentry><pt><varname>name</varname></pt><pd>The name of the rule to remove.</pd></plentry><plentry><pt><varname>table_name</varname></pt><pd>The name (optionally schema-qualified) of the table or view that
the rule applies to. </pd></plentry><plentry><pt>CASCADE</pt><pd>Automatically drop objects that depend on the rule. </pd></plentry><plentry><pt>RESTRICT</pt><pd>Refuse to drop the rule if any objects depend on it. This is the
default. </pd></plentry></parml></section><section id="section5"><title>Examples</title><p>Remove the rewrite rule <codeph>sales_2006</codeph> on the table <codeph>sales</codeph>:</p><codeblock>DROP RULE sales_2006 ON sales;</codeblock></section><section id="section6"><title>Compatibility</title><p><codeph>DROP RULE</codeph> is a Greenplum Database language extension, as is the entire query
        rewrite system.</p></section><section id="section7"><title>See Also</title><p><codeph><xref href="ALTER_RULE.xml#topic1"/></codeph>, <codeph><xref
            href="CREATE_RULE.xml#topic1" type="topic" format="dita"/></codeph></p></section></body></topic>
